<template>
    <div class="adService" ref="adService">
        <div class="name">
            <div class="title">{{ name }}</div>
        </div>
        <iframe :src="adUrl" frameborder="0"></iframe>
        <div class="closeBtn" @click="closeAD">X</div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
const props = defineProps({
    name: String,
    sub: String,
    adUrl: String
})
const adService = ref(null)
const closeAD = () => {
    console.log('close')
    adService.value.style.display = 'none'
}
</script>
<style scoped lang="scss">
.adService {
    z-index: 9999;
    position: fixed;
    top: 50%;
    left: 20px;
    width: 300px;
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #000;

    .name {

        .title {
            font-size: 24px;
            font-weight: 600;
        }

        .sub {
            font-size: 20px;
            font-weight: 400;
        }
    }

    iframe {
        width: 100%;
        height: 100%;
    }

    .closeBtn {
        position: absolute;
        right: 10px;
        font-size: 20px;
        font-weight: 600;
        cursor: pointer
    }
}
</style>